import json

import requests

import kkl_config


class GoProxy:
    def __init__(self):
        self.url = kkl_config.URL_GO

    def goProxy(self, data):
        cookies = {"xhxtoken": kkl_config.Token.xhxtoken}
        respone = requests.post(self.url, json=data, cookies=cookies)
        kkl_config.prints(respone)
        res = respone.json()
        print(json.dumps(res, ensure_ascii=False, indent=2))


if __name__ == "__main__":
    from scripts01.login01 import LoginApi

    LoginApi().xhxLogin()
    data = {"service_name": "salesmng.OrderPayFacade.refreshOrderPayStatus",
            "param": {"orderNo": "xhx175248041059563502929"}}
    GoProxy().goProxy(data)
